﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="fleet.ascx.cs" Inherits="fleet" %>

<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
    GroupItemCount="3">
    <AlternatingItemTemplate>
        <td runat="server"  style="background-color:#151613;" width="210px" heiht="30px">
            <a href="<%= Request.Url.ToString() %>&Fleet=<%# Eval("ID") %>">
               <img src="images/taxiTiny.png" alt="TAXI"/>
                <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>'  ForeColor="#F0F0F0"  Font-Size="18px" />
            </a>
            <br />
            <br />
        </td>
    </AlternatingItemTemplate>
    <EditItemTemplate>
        <td runat="server" style="background-color: #FFCC66;color: #000080;">
            Name:
            <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <br />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br />
        </td>
    </EditItemTemplate>
    <EmptyDataTemplate>
        <table runat="server" 
            style="background-color: #151613;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
            <tr>
                <td>
                    No fleet returned.</td>
            </tr>
        </table>
    </EmptyDataTemplate>
    <EmptyItemTemplate>
        <td runat="server"  style="background-color:#151613;" width="210px" heiht="30px"/>
    </EmptyItemTemplate>
    <GroupTemplate>
        <tr ID="itemPlaceholderContainer" runat="server">
            <td ID="itemPlaceholder" runat="server">
            </td>
        </tr>
    </GroupTemplate>
    <InsertItemTemplate>
        <td runat="server" style="">
            Name:
            <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <br />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br />
        </td>
    </InsertItemTemplate>
    <ItemTemplate>
        <td runat="server"  style="background-color:#151613;" width="210px" heiht="30px">
            <a href='<%= Request.Url.ToString() %>&Fleet=<%# Eval("ID") %>'>
               <img src="images/taxiTiny.png" alt="TAXI"/>
                <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>'  ForeColor="#F0F0F0"  Font-Size="18px" />
            </a>
            <br />
            <br />
        </td>
    </ItemTemplate>
    <LayoutTemplate>
        <table runat="server">
            <tr runat="server">
                <td runat="server">
                    <table ID="groupPlaceholderContainer" runat="server" border="0" 
                        style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                        <tr ID="groupPlaceholder" runat="server">
                        </tr>
                    </table>
                </td>
            </tr>
            <tr runat="server">
                <td runat="server" 
                    style="text-align: center;background-color: #151613;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFF000;">
                    <asp:DataPager ID="DataPager1" runat="server" PageSize="27">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="True" FirstPageText="<<<" PreviousPageText="<" NextPageText=">" LastPageText=">>>" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" 
                                ShowNextPageButton="True" ShowPreviousPageButton="False" FirstPageText="<<<" PreviousPageText="<" NextPageText=">" LastPageText=">>>" />
                        </Fields>
                    </asp:DataPager>
                </td>
            </tr>
        </table>
    </LayoutTemplate>
    <SelectedItemTemplate>
        <td runat="server" 
            style="background-color: #FFCC66;font-weight: bold;color: #000080;">
            Name:
            <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
            <br />
        </td>
    </SelectedItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:conn %>" 
    SelectCommand="SELECT dbo.Fleet.Name, dbo.ConnectionFleetTown.TownID, dbo.Fleet.ID FROM dbo.ConnectionFleetTown INNER JOIN dbo.Fleet ON dbo.ConnectionFleetTown.FleetID = dbo.Fleet.ID WHERE (dbo.ConnectionFleetTown.TownID = @TownID)">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="438" Name="TownID" 
            QueryStringField="TownID" />
    </SelectParameters>
</asp:SqlDataSource>
